package com.yuyou.train.user.service.impl;

import com.yuyou.train.service.api.user.dto.UserFeedbackPageDTO;
import com.yuyou.train.service.api.user.entity.UserFeedback;
import com.yuyou.train.user.mapper.UserFeedbackMapper;
import com.yuyou.train.user.service.IUserFeedbackService;
import com.yuyou.train.util.bean.Pagination;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

/**
 * Created by yujin.liu on 2018/1/30.
 */
@Service
public class UserFeedbackServiceImpl implements IUserFeedbackService{

    @Autowired
    private UserFeedbackMapper userFeedbackMapper;

    @Override
    public int insert(UserFeedback userFeedback) {
        return userFeedbackMapper.insert(userFeedback);
    }

    @Override
    public int findUserFeedbackPageCount(Pagination<UserFeedbackPageDTO> p) {

        return userFeedbackMapper.findUserFeedbackPageCount(p);

    }

    @Override
    public List<UserFeedbackPageDTO> findUserFeedbackPageList(Pagination<UserFeedbackPageDTO> p) {
        return userFeedbackMapper.findUserFeedbackPageList(p);
    }

    @Override
    public int updateByPrimaryKeySelective(UserFeedback userFeedback) {
        userFeedback.setUpdateTime(new Date());
        return userFeedbackMapper.updateByPrimaryKeySelective(userFeedback);
    }

    @Override
    public int deleteByPrimaryKey(String id) {
        return userFeedbackMapper.deleteByPrimaryKey(id);
    }


}
